UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hpxMiekptgRC//1XNNm+1BFp5H0q/tRqbVF53Hr1F3w=' 
WHERE 
  key_id = 'd707e760b4f6ca25db2aee316736e91be81de6a05b12bdaa661e28e900f7218a' 
  AND (
    token = 'hpxMiekptgRC//1XNNm+1BFp5H0q/tRqbVF53Hr1F3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033