UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+tjtCrBEMgI1Ak4JhVdxj0b7TXciEkuIp6aUmSFoYMA='
WHERE
key_id = '8180103916bd9dd9ab8bbff31fcf188044f8f082be76b92016ce45ee72f9f397'
AND (
token = '+tjtCrBEMgI1Ak4JhVdxj0b7TXciEkuIp6aUmSFoYMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)