UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xe7j67gww1qJ53jFTeinuTSaQvB3rUIXrUXOK0OSE8o=' 
WHERE 
  key_id = '4cfbea1376f8b673967e4a5ee998ccd3a4b9a27e74657a703d94174a80cba2ca' 
  AND (
    token = 'Xe7j67gww1qJ53jFTeinuTSaQvB3rUIXrUXOK0OSE8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031