UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R62mvhf4EI4KuGBf0mvecCVzN21lcWbO2Rr0wmRknAI=' 
WHERE 
  key_id = '2454063149360a47c2fdf96bdc8a5f64b64efd50e9e9e71d21d92ce598cac4b3' 
  AND (
    token = 'R62mvhf4EI4KuGBf0mvecCVzN21lcWbO2Rr0wmRknAI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041