UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PsZRxnnfroffdzYGdZ+m7Q/S5ppOBeeTrUwplOae/Sk=' 
WHERE 
  key_id = '949fc012429065298992e94a18c9959a8302fd045d61b97297cb7af0f831505e' 
  AND (
    token = 'PsZRxnnfroffdzYGdZ+m7Q/S5ppOBeeTrUwplOae/Sk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022