UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ex+AjwY8lWpC0uFlAecJIkJDvJ9XuNyArD+tUMbqw+E='
WHERE
key_id = '088387198cb4bc674dc65a786337d745d311e864ded5d5255a28817ad164b70b'
AND (
token = 'ex+AjwY8lWpC0uFlAecJIkJDvJ9XuNyArD+tUMbqw+E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)