UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '30c2Ff2czXvS87Ql+i8sBJJoMLlK7uD/Daab5c2YPHU=' 
WHERE 
  key_id = '5753ebeb48b377eb44eb746d1350a660bab7fa42b63c8dd3c6fb3fa6e409437c' 
  AND (
    token = '30c2Ff2czXvS87Ql+i8sBJJoMLlK7uD/Daab5c2YPHU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036