UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'paNJFraK6R7YjsRYMgWHPeXuWwI9onIL1IZGAxVCXIU='
WHERE
key_id = '74abb8aeb461af5280af08db8f38d02c2af22062878d3866e7b4fc0d82db5ad6'
AND (
token = 'paNJFraK6R7YjsRYMgWHPeXuWwI9onIL1IZGAxVCXIU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)