UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ENEedgorDY7Ow2/6QhFnhTGNvBswy4u9/+PMBftoITc='
WHERE
key_id = 'c02b16a02178e9877aec5bcb1ecc4163f21b1c2cb4cd446a7de2f3a2558c0be2'
AND (
token = 'ENEedgorDY7Ow2/6QhFnhTGNvBswy4u9/+PMBftoITc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)