UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4CcOXU+wq4l4cDs0npgUyRyTU3lOqhwZLR9w/5BqG8U='
WHERE
key_id = '46aeed8be8401b049103013a4d50ea509f13a2483823ad540e8cc279c7811291'
AND (
token = '4CcOXU+wq4l4cDs0npgUyRyTU3lOqhwZLR9w/5BqG8U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)