UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ONgccEUb1XOxTNedi4vMTuUyqZHcmN36MOoyLsA7Kzc='
WHERE
key_id = '6a309f0fc2c52a8354c6163e7a9fd7aa5cbbeb5db6a6a2bb9ff6527241973c20'
AND (
token = 'ONgccEUb1XOxTNedi4vMTuUyqZHcmN36MOoyLsA7Kzc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)