UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RaiUpaoqGI1NapHDCdGrZpoe8TYcvjcNnk3C8Js3k1I=' 
WHERE 
  key_id = '08c589c47223dad84f60d16ba9c1f9fe2817ebc602fff350a4dc23ddfb030596' 
  AND (
    token = 'RaiUpaoqGI1NapHDCdGrZpoe8TYcvjcNnk3C8Js3k1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048