UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SMUl8smu2WnnF8uyYBzmBBLnLmfAmf7y50rb6fWyl/4='
WHERE
key_id = 'a329ff3ba57fa457973d019bda891fabb2b2f9d41caca1cfef6ccd14f155d3b1'
AND (
token = 'SMUl8smu2WnnF8uyYBzmBBLnLmfAmf7y50rb6fWyl/4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)