UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KUvYAAEsNPxOWo7+IauWaWAAU/nqH+7tozjinKnrj1g='
WHERE
key_id = '03bba6cf338e04678ef1c108f735eeba42f9d619a6f9856323e2fdb83db17e3a'
AND (
token = 'KUvYAAEsNPxOWo7+IauWaWAAU/nqH+7tozjinKnrj1g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)