UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4iRxWf0+9jFHY0ex22vdMG1HJH1wjKEakOc8b8FlgMk='
WHERE
key_id = '208735ee55c16f0af975189a2bdf97f784aab72872f39b116ea28446e928c24a'
AND (
token = '4iRxWf0+9jFHY0ex22vdMG1HJH1wjKEakOc8b8FlgMk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)