UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lh8gsCFs4sRthejzKcnOGrVEvFn+Kh1hw69+NayFC0s=' 
WHERE 
  key_id = 'ac2a96d9d82be9a444c37c5247668ca665444d1b0066fd472e1c9a48e548ae1b' 
  AND (
    token = 'Lh8gsCFs4sRthejzKcnOGrVEvFn+Kh1hw69+NayFC0s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047