UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lJ7ktUsbEs5LdvNB+tvbN11LKvJ5QUXYcSeJJC552Bo=' 
WHERE 
  key_id = 'fe6b4d169c39ecbc902865681eeb5ad9b060b6896830a95c76299af991f81225' 
  AND (
    token = 'lJ7ktUsbEs5LdvNB+tvbN11LKvJ5QUXYcSeJJC552Bo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030