UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MMjeM1DeAQzBBwtqveIIudllJvSSCHdErZ12G8m6wLo=' 
WHERE 
  key_id = 'e53229ac75ec86dd4df8627a33d0d8f9be9e326dc691df4dd1cf677fde34918f' 
  AND (
    token = 'MMjeM1DeAQzBBwtqveIIudllJvSSCHdErZ12G8m6wLo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030