UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4eKUq2CdJaP8/UWrItTDiJsSEuP0B14g0cZV3TtxvcM=' 
WHERE 
  key_id = '97926e993308e3c493aa9a4c7fd0063e025880e6d5c11e563c250159a68eb4bc' 
  AND (
    token = '4eKUq2CdJaP8/UWrItTDiJsSEuP0B14g0cZV3TtxvcM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00114