UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0VIiloiiiBBxIj59txw7eYIDoymXhEsw0mKIqxEvuEw='
WHERE
key_id = 'c95d0dd5d5a43a841b048bb3e9042c9b3375e2731fba377b80deb6b583472fe4'
AND (
token = '0VIiloiiiBBxIj59txw7eYIDoymXhEsw0mKIqxEvuEw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)