UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GbRp7uX9pyvsCiy0ldHRl6CNq/B1jF1c2uc26c5EXjc='
WHERE
key_id = 'b543958482a50b341a0d68ec589c5b31e5e8bd96d7aaf5631b826fbefb6459a4'
AND (
token = 'GbRp7uX9pyvsCiy0ldHRl6CNq/B1jF1c2uc26c5EXjc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)