UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't0k7diF8EN+dxWYjogFOuZMlBaVJauIuer7mpt38SEk=' 
WHERE 
  key_id = 'b96ee10907730154f700b13679919fc491aae524bd89b2cd8bd7ed86f0c8d2cd' 
  AND (
    token = 't0k7diF8EN+dxWYjogFOuZMlBaVJauIuer7mpt38SEk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021