UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bXvf4z1vciL+iMOK1VV3mIR32VpkNwgP+HvD8s//IWQ='
WHERE
key_id = '33eea7b0ec792eec37a9e96be74f09a960d19150f6f9149a7d1dfc0194039302'
AND (
token = 'bXvf4z1vciL+iMOK1VV3mIR32VpkNwgP+HvD8s//IWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)