UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5raP95cAjeSo5Pf/a/utk2C6yqVZi0WpQv98yZAugzs=' 
WHERE 
  key_id = '4b6529010a57057aedcca2c12812fc36fdfc21215a42a15bae38c1b7ccc6015a' 
  AND (
    token = '5raP95cAjeSo5Pf/a/utk2C6yqVZi0WpQv98yZAugzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039