UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RwNyvwbIMO8HX62Bs5tMK0A0e2dT0oG5ZaTIKGZH/K8=' 
WHERE 
  key_id = 'c9ac2a57314a61d2bacc1b277378dcfaa356db4a85b9571f63ee96e47db353b6' 
  AND (
    token = 'RwNyvwbIMO8HX62Bs5tMK0A0e2dT0oG5ZaTIKGZH/K8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032