UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZTZyF9ww/tFWA7k5EEcLeEeTqNIUILdJcP/NfBtN+Ho=' 
WHERE 
  key_id = 'fadea89ab3b2914b19c8f564c5a9072ddbd62c027438a0318e2f7f0179d49bc1' 
  AND (
    token = 'ZTZyF9ww/tFWA7k5EEcLeEeTqNIUILdJcP/NfBtN+Ho=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028