UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xoHUYv+i3itcB9z1zwFgCOmT4HyJBMxe0/rsl1lPCIE='
WHERE
key_id = '4245454e3ee7355912f8bc253b0af1d60f4dbd8301d6c810af5add28c207c044'
AND (
token = 'xoHUYv+i3itcB9z1zwFgCOmT4HyJBMxe0/rsl1lPCIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)