UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CJ/aMoCdcXgAckAAYnYu5D0gZZuVe1fK+PVj+E1cJD0='
WHERE
key_id = '06701eac97c6905eaf67249d828ddc05ef20b901d8540015c2e8c1ef997e1456'
AND (
token = 'CJ/aMoCdcXgAckAAYnYu5D0gZZuVe1fK+PVj+E1cJD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)