UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DfTPW6KPq8wOaXxKgXtfz3fWlqU7Pdiaj6PW0tx5SBk='
WHERE
key_id = '88cf2ce27ea9f06930f5cb53357d40e7ae427d67154f53b56019eb9bbf183ca4'
AND (
token = 'DfTPW6KPq8wOaXxKgXtfz3fWlqU7Pdiaj6PW0tx5SBk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)