UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OZuqasZyIYwut7Ho+HgEUPbAQL0W78Z9M7bbeWh/MwE=' 
WHERE 
  key_id = '22488e515a2954bf5fc0e8cf706d3c5ee52af12dcefba31ed6e32adc3aacf16c' 
  AND (
    token = 'OZuqasZyIYwut7Ho+HgEUPbAQL0W78Z9M7bbeWh/MwE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019