UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l+25tqiRsX+W0SVMzlj9kpF72vtg73jnRpIiI+IFoKc=' 
WHERE 
  key_id = '5b776c301117348bd04bf708af8e80ecb3a13e59d0a8bf98d1506cdcc0f7169e' 
  AND (
    token = 'l+25tqiRsX+W0SVMzlj9kpF72vtg73jnRpIiI+IFoKc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035