UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8S+wvkvKenDzE5seXAlmBaOSpUJ7g79WZEpUaStPrSk='
WHERE
key_id = '79bd799163255d5b19f35bb7cef2e981ff3f66be5f49336aafbfab8085d2a4b0'
AND (
token = '8S+wvkvKenDzE5seXAlmBaOSpUJ7g79WZEpUaStPrSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)