UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4c8yG3NpO+Um5kDe8lm11ow9kftX1Rz3Yh5jMfiGSp4=' 
WHERE 
  key_id = '986b8b4abf5961823c90ba1257ce7bd07a283d0f39cb71e358a64fb5224acf8d' 
  AND (
    token = '4c8yG3NpO+Um5kDe8lm11ow9kftX1Rz3Yh5jMfiGSp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061