UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XiFNGUCE+EDU1SXkUFeUr/MSXfyxvmtPzdXROGfjMuQ='
WHERE
key_id = '3f18e9bbb3319230e817cdc809a4c229472e977b1724b578a8cf8d892ec46383'
AND (
token = 'XiFNGUCE+EDU1SXkUFeUr/MSXfyxvmtPzdXROGfjMuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)