UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IhlMP2ssQhNBY6kEhtNA2E+AsjYYc6BWT5nXfhWXnVk='
WHERE
key_id = 'baad41859fc7f3f4a530e7dc6b410f60a1690e2cd6ee2e0dcc3e587466fe4875'
AND (
token = 'IhlMP2ssQhNBY6kEhtNA2E+AsjYYc6BWT5nXfhWXnVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)