UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DFP8yRLHN29okbp5NfG07JtodB9EqnZUi16/ErLKmB0='
WHERE
key_id = '372706f33c55bb40262535d1b981d346ffb186ce8fb9cb39fa19a9177835ebc2'
AND (
token = 'DFP8yRLHN29okbp5NfG07JtodB9EqnZUi16/ErLKmB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)