UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LQlhXFevwbAh6+efLsMMNOzk7ZvywvSGlbJP7WBjis8=' 
WHERE 
  key_id = 'e72f002ed6030e608e38332530da9cfe28e2fe4ce32c76aca3373b4d863a544a' 
  AND (
    token = 'LQlhXFevwbAh6+efLsMMNOzk7ZvywvSGlbJP7WBjis8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043