UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gukQotUK8k+qARyEfaTxmBBxNdgoIbV4YnffWCmPNpI=' 
WHERE 
  key_id = 'a128663a2df044f16909cb723c4f74301dfdd031900e71dc32ac75136b335630' 
  AND (
    token = 'gukQotUK8k+qARyEfaTxmBBxNdgoIbV4YnffWCmPNpI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042