UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VEtprrGxV2zX6NnbxQQAxOLlfPt6WtHYaOnN6Cm5Udc=' 
WHERE 
  key_id = '5ca249dc07e9a12a71c5d63e38eb8e32c28001db71e780d5bcab5b619d29618e' 
  AND (
    token = 'VEtprrGxV2zX6NnbxQQAxOLlfPt6WtHYaOnN6Cm5Udc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049