UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'es6EsB2PmqWZ6e06+S5w+ofpaQ5NnZqJe2KNLB53nh8=' 
WHERE 
  key_id = '106c144e93f56671026dcbdfecb886c1aef019d6b83f0b28ba255afff94529f3' 
  AND (
    token = 'es6EsB2PmqWZ6e06+S5w+ofpaQ5NnZqJe2KNLB53nh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034