UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MHu0eB8mIKf7FW+WowSrSiGrFFzM3MhZwMfzp4wQVaU='
WHERE
key_id = '6d3f0a0e640398d03a3cefac91d36b044fc991b63d5ba5e7fb94bd2cb9988672'
AND (
token = 'MHu0eB8mIKf7FW+WowSrSiGrFFzM3MhZwMfzp4wQVaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)