UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cVkjLPYXiiy+4L63n7mmGQSOZXIm9xrGt6EDQdR2McE=' 
WHERE 
  key_id = 'b2b326d07a4ab38b24a5b9b71d19ecfa7e9977e711681580c46e80d25575567f' 
  AND (
    token = 'cVkjLPYXiiy+4L63n7mmGQSOZXIm9xrGt6EDQdR2McE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028