UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+10iw/Ea3f3Z2KWkmb7KgArgZmnSokQaSSunfnTe+8Y=' 
WHERE 
  key_id = '96ec1649d46df195a885eaa50a81924f2d5eebcab032e052bbf5fae4bba863f2' 
  AND (
    token = '+10iw/Ea3f3Z2KWkmb7KgArgZmnSokQaSSunfnTe+8Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029