UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Db6GWf9SIZPwQfan6tyIQlSK8NK3G4FphJJqxquqEJs=' 
WHERE 
  key_id = 'ccd69cc9be12691240d21459ae6e561bfb3ae19305ca1e2175e66e0db806f28f' 
  AND (
    token = 'Db6GWf9SIZPwQfan6tyIQlSK8NK3G4FphJJqxquqEJs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025