UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '80/w35trxPyePP48mSy/+YXueL36zCdsCv5nxEUWt28='
WHERE
key_id = '322d2767930a76dc196e5b6255dd5532cd1d149ddcabc92bd57316cea711c231'
AND (
token = '80/w35trxPyePP48mSy/+YXueL36zCdsCv5nxEUWt28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)