UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lB7NJsROFtitqONPRmEQFGaMW22DJ4pAS0YudnlJPl8='
WHERE
key_id = '5f891bc205bd15b99fb99993706ea610d584317f2bed38ab1b470a71c181cf07'
AND (
token = 'lB7NJsROFtitqONPRmEQFGaMW22DJ4pAS0YudnlJPl8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)