UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'soqWbBQysPo60oec6CA4vVNP9uQMCQ149GdTo41hDSY=' 
WHERE 
  key_id = '4ba45e2e6ae43ad5e032ed27370efa895dcfbca2db6963fa2c193a1806ba7cfb' 
  AND (
    token = 'soqWbBQysPo60oec6CA4vVNP9uQMCQ149GdTo41hDSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022