UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CuJevG/QuBMSSR5jaNHteptB2CNwPc/3uwTEEdIDXAA='
WHERE
key_id = '2888896b9a659fb8045fa20c969f81eb381441536035c9f5155bf0776785af96'
AND (
token = 'CuJevG/QuBMSSR5jaNHteptB2CNwPc/3uwTEEdIDXAA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)