UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OarYjrahc6KF6aV11D/Gz0GaWFsQfxHM0qtM3ngdVyU=' 
WHERE 
  key_id = '46e8c40e5529d630ef71db02150b1dd83b67fa1f48b542a3ecd0a80da83e9b6e' 
  AND (
    token = 'OarYjrahc6KF6aV11D/Gz0GaWFsQfxHM0qtM3ngdVyU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031