UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0gfs1DDWUJI8Y7DzRbF0VYeBkOUufupWSmfYoS3+7UY=' 
WHERE 
  key_id = '7ca2f7bc5410955465aa0e47b27b24a70df02bc9d7d535f8736bd1299a4abf6c' 
  AND (
    token = '0gfs1DDWUJI8Y7DzRbF0VYeBkOUufupWSmfYoS3+7UY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030