UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EWNTWE/54Z43yk8ub0j82YDTb/4719BQ828me19Ih+0=' 
WHERE 
  key_id = '70f2432650434248ffe67ac2c94afaf094f484a7f1c012e2420bb48438eff650' 
  AND (
    token = 'EWNTWE/54Z43yk8ub0j82YDTb/4719BQ828me19Ih+0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031