UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5QI5ZUtBOHbkjgNQLt6z9fK7wZ9zzYb+Neg7u4nVDNU=' 
WHERE 
  key_id = 'cffe166b278736c97fda44d9310e29e443b60302a9fe327ba95ad8c4bc0a2443' 
  AND (
    token = '5QI5ZUtBOHbkjgNQLt6z9fK7wZ9zzYb+Neg7u4nVDNU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00073