UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EU7k2wFCyrV26Jsin6daepbG1aQDUGK8A0E3kyIfwII='
WHERE
key_id = '82d18a7cc72382d6d9ae95cbbb81aa5379796b21e1d59c22d4f4853f9244abb5'
AND (
token = 'EU7k2wFCyrV26Jsin6daepbG1aQDUGK8A0E3kyIfwII='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)