UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AXIQ54l0VWsKoL/WxeX745bw4+hCUtHR9GieUZUpauU=' 
WHERE 
  key_id = 'c813924b3a89f89037db58efbf341c8d7155e2e7ffa9768286b04590be3d4dc2' 
  AND (
    token = 'AXIQ54l0VWsKoL/WxeX745bw4+hCUtHR9GieUZUpauU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025