UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DySVKtTdL5sGBmdKKLTDzryG4HbO+rOt1P4gU94LoVk=' 
WHERE 
  key_id = '71c462d9ab8e8063cc7c0eb3b74363e6dca5fef89d36a824a03d31a50f05b5af' 
  AND (
    token = 'DySVKtTdL5sGBmdKKLTDzryG4HbO+rOt1P4gU94LoVk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030