UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fh0lR5U/OrIBz/kBJhbCcTNl29jaHwWcsURj6KKcfoI=' 
WHERE 
  key_id = 'afcdf02b7d36ec215af3dbf77b1c3eed8a28f2465f4861b8c4f4d199164779bf' 
  AND (
    token = 'fh0lR5U/OrIBz/kBJhbCcTNl29jaHwWcsURj6KKcfoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055