UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sna9v3eDBbEHKk04xQ+WoDvRBeSwTvb9KqJA0XCsTnk='
WHERE
key_id = '4423d0bc4b3fa5ea44ee8a79cc22f7e197af3920bda887c9a8713c999d5a2f84'
AND (
token = 'Sna9v3eDBbEHKk04xQ+WoDvRBeSwTvb9KqJA0XCsTnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)