UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ol/3eMFt2SXd4H59PhjD7VGPw4aO5T8rySweYn48fFY='
WHERE
key_id = '84deaaef895af54ce440c6b62031370f16e43ad911190e5d574357f7d3f563c4'
AND (
token = 'Ol/3eMFt2SXd4H59PhjD7VGPw4aO5T8rySweYn48fFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)