UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fR1NRjMUsEFlEjFQhHR4Y9L+2DbDs/sEmdzRGDa+RqE=' 
WHERE 
  key_id = 'f4057980f1c042dbc6f564e6dbae58d53e3ff95a747d4061ffc750cf8144185c' 
  AND (
    token = 'fR1NRjMUsEFlEjFQhHR4Y9L+2DbDs/sEmdzRGDa+RqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038